package com.zjt.smart.util;

import android.text.TextUtils;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2017</p>
 * <P>Company: </p>
 *
 * @author zhengjianting
 * @time 2017/11/3 0003 上午 10:36
 */

public class FileUtil {

    public static void writeFile (String fileName, String message) throws IOException {
        if (TextUtils.isEmpty(fileName) || TextUtils.isEmpty(message)){
            return;
        }
        File file = new File(fileName);
        FileOutputStream fos = new FileOutputStream(file);
        byte [] bytes = message.getBytes();
        fos.write(bytes);
        fos.close();
    }
}
